home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_name != "shipSTAT" && _currentframe == 1)
- {
- xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
- yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
- _rotation = Math.atan2(_X - _root.ship._x,_Y - _root.ship._y) / 0.017453292519943295 * -1;
- var i = 0;
- while(i <= 20)
- {
- if(sh.harea.hitTest(_root["hmn" + i]))
- {
- life -= _root["hmn" + i].dmg;
- sh.play();
- removeMovieClip(_root["hmn" + i]);
- pp = random(6);
- }
- i++;
- }
- if(_root.ship.sh.hitTest(sh.harea) && _root.missionbox.sttc._currentframe == 1)
- {
- _root.ship.play();
- }
- if(life <= 0)
- {
- play();
- }
- if(pp == 0)
- {
- _root.missionbox.sttc.play();
- }
- if(_root.missionbox.sttc._currentframe == 28)
- {
- _X = random(550);
- _Y = random(400);
- while(Math.abs(_X - _root.ship._x) < 100 || Math.abs(_Y - _root.ship._y) < 100)
- {
- _X = random(550);
- _Y = random(400);
- }
- }
- pp = random(100);
- if(_root.missionbox.sttc._currentframe == 1)
- {
- yy = random(20);
- if(yy == 0 && _currentframe == 1)
- {
- _root.fire(this);
- }
- }
- }
- if(_root.rem == true)
- {
- removeMovieClip(this);
- }
- }
-